package com.lsh.controller;

import com.lsh.pojo.Result;
import com.lsh.pojo.course;
import com.lsh.service.CoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@CrossOrigin
@RequestMapping("/stu-management")
public class CoController {

    @Autowired
    private CoService coService;

    @GetMapping("/co")
    public Result list() {
        List<course> colist = coService.list();
        return Result.success(colist);
    }

}
